package com.ui.activity;

import android.os.Bundle;

import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.core.sdk.core.BaseActivity;
import com.core.sdk.utils.ToastUtil;
import com.ui.R;

public class TestActionBarSherlockActivity extends BaseActivity {

	@Override
	protected int getContentView() {
		return R.layout.act_action_bar_sherlock;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		menu.add("Refresh")
				.setIcon(R.drawable.ic_arrow_refresh)
				.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
		//getSupportMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		if("Refresh".equals(item.getTitle())){
			ToastUtil.show(this,"Hello ActionbarSherlock");
		}
		return super.onOptionsItemSelected(item);
	}

}
